testsuite: more focus-chain output
authorMatthias Clasen <mclasen@redhat.com>
Tue, 11 Jun 2019 14:53:08 +0000 (14:53 +0000)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 11 Jun 2019 14:56:38 +0000 (14:56 +0000)
Differentiate between wrapping around and
stopping at the end of the focus chain.

Update the existing tests, and add two
new ones where the difference matters.

testsuite/gtk/focus-chain/basic.left [new file with mode: 0644]
testsuite/gtk/focus-chain/basic.right [new file with mode: 0644]
testsuite/gtk/focus-chain/basic.tab
testsuite/gtk/focus-chain/basic.tab-backward
testsuite/gtk/meson.build
testsuite/gtk/test-focus-chain.c

diff --git a/testsuite/gtk/focus-chain/basic.left b/testsuite/gtk/focus-chain/basic.left
new file mode 100644 (file)
index 0000000..de2b108
--- /dev/null
@@ -0,0 +1,3 @@
+entry2 GtkText
+entry1 GtkText
+STOP
diff --git a/testsuite/gtk/focus-chain/basic.right b/testsuite/gtk/focus-chain/basic.right
new file mode 100644 (file)
index 0000000..343910a
--- /dev/null
@@ -0,0 +1,3 @@
+entry1 GtkText
+entry2 GtkText
+STOP
index 120555fb036cfe9338caddb2006f5c2e26bba929..cf87509577e8b99c66eadd1f3fb2dfb5a7ad311d 100644 (file)
@@ -1,2 +1,3 @@
 entry1 GtkText
 entry2 GtkText
+WRAP
index 7a00af5387c4c134b7009ca42534a36c2470b414..764592b8e7c958f8006363e5b75ec74fe697500f 100644 (file)
@@ -1,2 +1,3 @@
 entry2 GtkText
 entry1 GtkText
+WRAP
index 60163207fe6627489cc6a778e5abf4a54195ff1a..f331e02d412b1d474d92413ee30a172f78280942 100644 (file)
@@ -134,6 +134,8 @@ focus_chain_tests = [
   # test     direction
   [ 'basic', 'tab' ],
   [ 'basic', 'tab-backward' ],
+  [ 'basic', 'left' ],
+  [ 'basic', 'right' ],
 ]
 
 focus_chain = executable(
index f8ac319947bcc12a2db63a72db8a2368ab4521d5..dac0d114ac5c979666df8ca3d4bf804a6d3022ae 100644 (file)
@@ -123,10 +123,16 @@ generate_focus_chain (GtkWidget        *window,
         name = g_strdup ("NONE");
 
       if (first && g_str_equal (name, first))
-        break; /* cycle completed */
+        {
+          g_string_append (output, "WRAP\n");
+          break; /* cycle completed */
+        }
 
       if (last && g_str_equal (name, last))
-        break; /* dead end */
+        {
+          g_string_append (output, "STOP\n");
+          break; /* dead end */
+        }
 
       g_string_append_printf (output, "%s\n", name);